#!/usr/bin/python
# -*- coding:UTF8 -*-
"""
话题相关
"""
import requests

__all__ = ['collect_topic']
# __all__ 用于限制from topic_apis import *的模块导入; 但仍然可以通过from model import B指定具体模块的方式进行导入。
base_url = 'http://101.132.254.254:3000/api/v1'


def creat_topic(token, title, tab, content):
    """
    :param token:String 用户的 accessToken
    :param title:String 标题
    :param tab:String 目前有 ask share job dev
    :param content:String 主体内容
    :return:
    """
    url = base_url + '/topics'
    jsondata = {
        "accesstoken": token,
        "title": title,
        "tab": tab,
        "content": content
    }
    return requests.post(url, json=jsondata)


def collect_topic(accesstoken, topic_id):
    """
    :param accesstoken:String 用户的 accessToken
    :param topic_id:String 主题的id
    """
    url = base_url + '/topic_collect/collect'
    jsondata = {
        'accesstoken': accesstoken,
        'topic_id': topic_id
    }
    return requests.post(url, json=jsondata)


if __name__ == '__main__':
    tsst_collect_topic = collect_topic('bb2c438b-1222-46ae-9145-29e8ec2427e6', '6266cd0775b714121234834e')
    print(tsst_collect_topic.text)


def name(a, b):
    print(f'{a}是{b}的师傅')


if __name__ == '__main__':  # 用来测试的输入main即可，调用时不会被显示
    name('张三', '李四')
